#!/usr/bin/make -f

# to re-generate debian/control, invoke
# fakeroot debian/rules debian/control DEB_AUTO_UPDATE_DEBIAN_CONTROL:=yes

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/dpatch.mk

DEB_CONFIGURE_SCRIPT_ENV += LDFLAGS=" -Wl,--as-needed"

INSTROOT = $(CURDIR)/debian/chmsee

install/chmsee::
	install -m755 cs2w/cs2w.py ${INSTROOT}/usr/bin/cs2w
	mkdir -p ${INSTROOT}/usr/share/chmsee/cs2w
	cp -r cs2w/template ${INSTROOT}/usr/share/chmsee/cs2w/
	find ${INSTROOT}/usr/share/chmsee/cs2w/template -name 'Makefile*' -exec rm -f {} \;
	dh_desktop -pchmsee
	
# copy from /usr/share/cdbs/1/class/gnome.mk
clean::
	cd $(DEB_BUILDDIR) && \
	  rm -f intltool-extract intltool-merge intltool-update po/.intltool-merge-cache; \
	  if test -d doc; then find doc -name '*.omf.out' -exec rm -f \{\} \; ; fi; \
	  if test -d help; then find help -name '*.omf.out' -exec rm -f \{\} \; ; fi
